import 'package:app/view_model/mymessage_model.dart';
import 'package:app/widget/provider_widget.dart';
import 'package:app/widget/tap_appbar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class MyMessage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(length: 4,
        child: Scaffold(
      appBar: TapAppBar(
          TapViewBar(
            TabBar(
                indicatorSize: TabBarIndicatorSize.label,
                isScrollable: true,
                tabs: <Widget>[
                  Tab(text: "全部消息"),Tab(text: "保养消息"),Tab(text: "提车消息"),Tab(text: "其他消息"),
                ],
              ),

          ),
          Size.fromHeight(ScreenUtil().setHeight(80))),
      body: ProviderWidget<MyMessageModel>(model: MyMessageModel(), builder: (context,model,child){
        return TabBarView(
          children: <Widget>[
            ListView.builder(itemCount: 10,itemBuilder:(context,index){
              return getItemBuilder(context, index);
            }),
            ListView.builder(itemCount: 10,itemBuilder:(context,index){
              return getItemBuilder(context, index);
            }),
            ListView.builder(itemCount: 10,itemBuilder:(context,index){
              return getItemBuilder(context, index);
            }),
            ListView.builder(itemCount: 10,itemBuilder:(context,index){
              return getItemBuilder(context, index);
            })
          ],
        );
      }),
    ));
  }
  Widget getItemBuilder(BuildContext context,int index){
    return Text("消息");
  }
}
